    package hello;

    /**
     * 线程的几种创建方法
     */
    public class threadHello {
        public static void main(String[] args) {
            new Thread() {
                public void run() {
                    for (int i = 0; i < 100; i++) {
                        if (i % 2 == 0) {
                            System.out.println("name"+Thread.currentThread().getName() + ":"+i);
                            System.out.println("id"+Thread.currentThread().getId()+":"+i);
                            System.out.println("设置线程等级"+Thread.currentThread().getPriority());
                            System.out.println("活动线程数"+Thread.activeCount());
                        }
                    }
                }
            }.start();

        }
    }
